home *** CD-ROM | disk | FTP | other *** search
/ Aminet 12 / Aminet 12 (1996)(GTI - Schatztruhe)[!][Jun 1996].iso / Aminet / dev / e / eiffel.lha / flc / framework / COLLECTION < prev    next >
Encoding:
Text File  |  1996-01-27  |  751 b   |  39 lines

  1.  
  2. -- Collection class
  3.  
  4. indexing
  5.  
  6.   names: collection, container, data_structures;
  7.   contents: generic;
  8.  
  9.   author: "Guichard Damien";
  10.   created: 9,November,1995;
  11.   modified: 9,November,1995
  12.  
  13. deferred class COLLECTION
  14. feature
  15.   add (element:COLLECTION) is
  16.     -- Add an element to the collection.
  17.     require  -- element /= Void
  18.     deferred
  19.     end  -- add
  20.   find (key:ANY):like Current is
  21.     -- Find first occurrence in the collection matching 'key'.
  22.     deferred
  23.     end  -- find
  24.   count:INTEGER is
  25.     -- Available elements.
  26.     deferred
  27.     end  -- count
  28.   empty:BOOLEAN is
  29.     -- Is collection empty?
  30.     do
  31.       Result := count = 0
  32.     ensure
  33.       -- Result = (count = 0)
  34.     end  -- empty
  35. invariant
  36.   -- count >= 0
  37. end  -- class 'COLLECTION'
  38.  
  39.